#!/bin/sh
# This regression test is a part of SIPp.
# -cid_str keeps a '%' that starts no conversion, with the letter after
# it, as it is.
. "`dirname "$0"`/../functions"; init

rm -f uac_*_logs.log
sippfg -sf uac.xml -i 127.0.0.1 -p 24340 -m 1 -timeout 10 \
    -cid_str 'a%xb%%c%u' 127.0.0.1:24341 -trace_logs >/dev/null 2>&1
status=$?
logs=`cat uac_*_logs.log 2>/dev/null`
rm -f uac_*_logs.log

if test $status -ne 0; then
    fail "the scenario failed with $status"
elif test "$logs" != "a%xb%c1"; then
    fail "logged '$logs', not 'a%xb%c1'"
else
    ok
fi
